package com.emode.service;

import java.util.List;


import com.emode.base.BaseDaoImpl;
import com.emode.base.Pager;
import com.emode.entity.Bbsreply;
import com.emode.service.imp.IReplyService;

public class ReplyService extends BaseDaoImpl<Bbsreply> implements IReplyService{
	//根据ID列出所有的 回复
	@Override
	public List listreply(Integer integer,Pager p) {
		String hql = "from Bbsreply r where rtid= ?";
		return PageQuery(hql, p,integer);
	}

	@Override
	public void updateViewCount(Integer integer) {
		String sql = "update Bbsreply r set r.rclickcount =r.rclickcount+1 where r.rid= ";
		makeTransientByIds(sql,integer);
	}
	@Override
	public int countReply(Integer integer) {
		String hql = "select count(r)from Bbsreply r where rtid= ?";
		return getCount(hql,integer);
	}
}
